import request from "../utils/request"
import { addRootUserTs,thisPageTs,deleteRootUserTs } from "../type/api";
//获取管理员数据
export const getRootUser = () => {
    return request.post('/getRootUser')
}
//添加管理员数据
export const addRootUser = (data:addRootUserTs) => {
    return request.post('/addRootUser',data)
}
//分页
export const getpageData = (data:thisPageTs) => {
    return request.post('/getpageData',data)
}
//删除管理员数据
export const deleteRootUser = (data:deleteRootUserTs) => {
    return request.post('/deleteRootUser',data)
}
export const getViod = (data:{url:string}) => {
    return request.post('/getViod',data,{responseType: 'blob'})
}

//用户页面数据
export const userData = () => {
    return request.post('/userData')
}

//添加数据
export const UpUserData = (data:{num:number,id:string}) => {
    return request.post('/UpUserData',data)
}

//封禁账户
export const BanUserData = (data:{id:string}) => {
    return request.post('/BanUserData',data)
}
//封禁账户
export const ReleaseUserData = (data:{id:string}) => {
    return request.post('/ReleaseUserData',data)
}

//获取公告
export const getAnn = () => {
    return request.post('/getAnn')
}
//添加公告
export const addAnn = (data:{ann:string}) => {
    return request.post('/addAnn',data)
}
//删除公告
export const deleteAnn = (data:{id:string}) => {
    return request.post('/deleteAnn',data)
}
//添加积分购买
export const addBuy = (data:{money:string,integral:string}) => {
    return request.post('/addBuy',data)
}
//获取积分购买
export const getBuy = () => {
    return request.post('/getBuy')
}
//删除积分购买
export const deleteBuy = (data:{id:string}) => {
    return request.post('/deleteBuy',data)
}
//判断token
export const istoken = () => {
    return request.post('/istoken')
}
//登录
export const rootLogin = (data:{ mail:string, password:string }) => {
    return request.post('/rootLogin',data)
}